/**
 * token相关
 */
import { defineStore } from "pinia";
import { ref, computed } from "vue";

export const tokenState = defineStore("token", () => {
  const token = ref("");

  function setToken(newToken: string) {
    token.value = newToken;
  }

  const getToken = computed(() => token.value);

  return {
    token,
    getToken,
    setToken,
  };
});
